package com.itheima.web.service.impl.oms;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.service.oms.OmsOrderItemService;
import com.itheima.vo.oms.OmsOrderItem;
import com.itheima.web.mapper.oms.OmsOrderItemMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class OmsOrderItemServiceImpl extends ServiceImpl<OmsOrderItemMapper, OmsOrderItem>
                                        implements OmsOrderItemService{
    @Autowired
    private OmsOrderItemMapper omsOrderItemMapper;
    //根据订单id查询订单所包含的商品
    @Override
    public List<OmsOrderItem> findOrderItem(Long orderId) {
        LambdaQueryWrapper<OmsOrderItem> lqw = new LambdaQueryWrapper<>();
        lqw.eq(OmsOrderItem::getOrderId,orderId);
        return omsOrderItemMapper.selectList(lqw);
    }
}
